﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Jzy.Model.CRM;
using Jzy.DAL.CRM;

using Frame.Lib.Core.Base;
using Frame.Lib.Utilities;

namespace Jzy.BLL.CRM
{
    public class CustomerContactBO : CommonOperate<CustomerContactInfo>
    {
        private CustomerContactDAL _customerContact;
        protected override BaseDAL DAL
        {
            get
            {
                return _customerContact;
            }
        }
        public CustomerContactBO()
        {
            _customerContact = new CustomerContactDAL();
        }

        public override CustomerContactInfo GetInfo(object id)
        {
            CustomerContactInfo info = base.GetInfo(id);
            info.GetCustomer = customerID => (new CustomerBO()).GetInfo(customerID);
            return info;
        }

        public List<CustomerContactInfo> GetList(int customerID)
        {
            List<CustomerContactInfo> list = _customerContact.GetList(customerID);
            return list;
        }

        public void LogicDelete(string ids)
        {
            List<int> lstIDs = StrUtil.SplitToInt(ids);

            _customerContact.LogicDelete(lstIDs);
        }
    }
}
